#ifndef SELFFORM_H
#define SELFFORM_H

#include <QWidget>
#include <QStandardItemModel>
#include <QMutex>
#include "common.h"
#include "mymodel.h"

#define SelfFormIns SelfForm::Instance()

namespace Ui {
class SelfForm;
}

class SelfForm : public QWidget
{
    Q_OBJECT

public:
    explicit SelfForm(QWidget *parent = nullptr);
    ~SelfForm();

    static SelfForm *Instance();

public:
    void flashBMS39AUI(int tempNum, int tempNo, double tempVal, int cellNum, int cvNO, double cellVolt);
    void flushUIBMS208View(const QList<BMS_Normal> &modelData);

private:
    void initTableView();
    void upDateModelView(QStandardItemModel *model ,int totalCount, int id, double value);    

private:
    Ui::SelfForm *ui;

    QStandardItemModel *m_temp_model;
    QStandardItemModel *m_cell_model;
    MyModel *m_208model;

    QMutex m_mutex;
};

#endif // SELFFORM_H
